<%--
  Created by IntelliJ IDEA.
  User: admin
  Date: 2023-10-25
  Time: 9:42
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>Title</title>
</head>
<body>

    <form action="/findEmployeesLikeName" method="get">
        <input type="text" name="name" placeholder="请输入要搜索的姓名">
        <input type="submit" value="搜索">
    </form>
    <table width="800px" border="1px">
        <caption>员工管理系统</caption>
        <tr>
            <th>编号</th><th>姓名</th><th>年龄</th><th>性别</th><th>部门id</th><th>职位</th>
            <th>照片</th><th>操作</th>
        </tr>
        <c:forEach var="emp" items="${employees}">
            <tr>
                <td>${emp.id}</td>
                <td>${emp.name}</td>
                <td>${emp.age}</td>
                <td>${emp.gender}</td>
                <td>${emp.deptId}</td>
                <td>${emp.position}</td>
                <td>
                    <a href="/download?filename=${emp.image}" title="点击下载">
                        <img style="width: 40px;height: 40px" src="/upload-images/${emp.image}">
                    </a>
                </td>
                <td>
                    <a href="/findEmployeeById?id=${emp.id}">更新</a>
                </td>
            </tr>
        </c:forEach>
    </table>
</body>
</html>
